package com.xhh.interview.controller.v1;

import com.xhh.interview.service.InterviewService;
import com.xhh.model.common.dtos.ResponseResult;
import com.xhh.model.interview.dtos.InterviewPageDto;
import com.xhh.model.interview.dtos.SendNoticeDto;
import com.xhh.model.interview.dtos.UpdateStatusDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@Api(tags = "复试通知管理接口")
@RestController
@RequestMapping("/interview")
@RequiredArgsConstructor
public class InterviewController {

    private final InterviewService interviewService;

    @ApiOperation("发送复试通知")
    @PostMapping("sendNotice")
    public ResponseResult notice(@RequestBody SendNoticeDto dto){
        return interviewService.notice(dto);
    }

    @ApiOperation("查看复试通知")
    @GetMapping("getNotice")
    public ResponseResult getNotice(){
        return interviewService.getNotice();
    }

    @ApiOperation("处理复试通知")
    @PutMapping("markNoticeStatusAcceptOrRefuse")
    public ResponseResult markNoticeStatusAcceptOrRefuse(@RequestBody UpdateStatusDto dto){
        return interviewService.markNoticeStatusAcceptOrRefuse(dto);
    }

    @ApiOperation("分页条件查询复试通知")
    @GetMapping("getNoticeByPageAndCondition")
    public ResponseResult getNoticeByPageAndCondition(InterviewPageDto dto){
        return interviewService.getNoticeByPageAndCondition(dto);
    }
}
